#ifndef BOSS_Afterburner_Globals_Functions_Plotstyle_H
#define BOSS_Afterburner_Globals_Functions_Plotstyle_H

#include "TAxis.h"
#include "TGraph.h"
#include "TH1.h"
#include "TH1F.h"

namespace BOSS_Afterburner
{
  /// @addtogroup Afterburner_functions
  /// @{
  /// BESIII Plotstyle: format functions.
  /// @remark  Original name: `bes3plotstyle.C` / `bes3plotstyle.h`.
  /// @author  Niklaus Berger (nberger@ihep.ac.cn)
  /// @date    August, 2009
  namespace Plotstyle
  {
    void FormatData(TH1* datahist);
    void FormatData(TGraph* datagraph);
    void FormatAxis(TAxis* axis);
    void FormatMC1(TH1* mc1hist);
    void FormatMC1(TGraph* mc1hist);
    void FormatMC2(TH1* mc1hist);
    void FormatMC2(TGraph* mc1hist);
    void FormatMC3(TGraph* mc1hist);

    void NameAxes(TH1* datahist, char* xname, char* yname);

    void WriteBes3();
    void WritePreliminary();

    void MakeLegend(TH1* datahist, char* dataname, TH1* mc1hist = 0, char* mc1name = 0,
                    TH1* mc2hist = 0, char* mc2name = 0, double xlow = 0.55, double ylow = 0.5,
                    double xhi = 0.94, double yhi = 0.7);

    void MakeLegend(TGraph* datahist, char* dataname, TGraph* mc1hist = 0, char* mc1name = 0,
                    TGraph* mc2hist = 0, char* mc2name = 0, TGraph* mc3hist = 0, char* mc3name = 0,
                    double xlow = 0.55, double ylow = 0.5, double xhi = 0.94, double yhi = 0.7);

    void MakeLegend(TH1* datahist, char* dataname, char** functionnames, double xlow = 0.55,
                    double ylow = 0.5, double xhi = 0.94, double yhi = 0.7);

    void SetStyle();
    void SetPrelimStyle();
    void SetMeetingStyle();

    void PlotDataMC(char* filename, TH1* datahist, char* dataname, TH1* mc1hist = 0,
                    char* mc1name = 0, TH1* mc2hist = 0, char* mc2name = 0, int prelim = 1,
                    double xlow = 0.55, double ylow = 0.5, double xhi = 0.94, double yhi = 0.7);
    void PlotDataFit(char* filename, TH1F* datahist, char* dataname, char** functionnames,
                     int prelim = 1, double xlow = 0.55, double ylow = 0.5, double xhi = 0.94,
                     double yhi = 0.7);
    void PlotScatter(char* filename, TH1* datahist, int prelim = 1);
  } // namespace Plotstyle
} // namespace BOSS_Afterburner

#endif
